/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ManagedBeans;

import Beans.Interest;
import dao.InterestDao;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**

 @author jtanguay
 */
@ManagedBean
@RequestScoped
public class InterestManager implements Serializable {

  //Attribut
  private Interest interest;

  public InterestManager() {
  }

  //Getter and setter
  public Interest getInterest() {
    return interest;
  }

  public void setInterest(Interest interest) {
    this.interest = interest;
  }

  @PostConstruct
  public void init() {
    interest = new Interest();
  }

  //Recuperer tous les interet
  public static List<Interest> getAllInterest() {
    List<Interest> InterestList = InterestDao.getInterestList();
    return InterestList;
  }
}
